package com.br.eaccount.code.controller;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.br.eaccount.code.model.CommCodeModel;
import com.br.eaccount.code.model.CommGrpCodeModel;
import com.br.eaccount.code.service.CodeService;
import com.br.framework.exception.ServiceException;

@Controller
public class CodeController {
	
	@Autowired
	CodeService codeService;
	
	@RequestMapping("/code/inqireGrpCodeList")
	public String inqireGrpCodeList(@ModelAttribute("grpCodeModel")CommGrpCodeModel grpCodeModel, Model model )throws ServiceException{
		List<CommGrpCodeModel> commGrpCodeList = codeService.inqireGroupCodeList(grpCodeModel);
		model.addAttribute("commGrpCodeList", commGrpCodeList);
		return "code/inqireGrpCodeList";
	}
	
}
